﻿<?php
include "includeFiles.php";
include "page.php";
if(empty($cateid)) $cateid=11110;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=7" />

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $C['Title'];?></title>
<Link href="../uploadfile/ico/<?php echo $C['ICO'];?>" rel="Shortcut Icon">
<meta name="Keywords" content="<?php echo $C['Keywords'];?>">
<meta name="description" content="<?php echo $C['Description'];?>">
<Meta name="Copyright" Content="<?php echo $C['CopyRight'];?>">
 <script type="text/javascript">
<!--
function checkFrm(dom){
	 if(dom.kahao.value==""){
		alert('请输入卡号');	
		dom.oldpwd.focus();
		return false;
	}
	 else if(dom.zhifen.value == ""){
			alert('请输入积分');	
			dom.user_repws.focus();
			return false;
		} else if(dom.password.value == ""){
		alert('请输入密码');	
		dom.user_repws.focus();
		return false;
	}
	else{
		return true;	
	}
}
-->
</script>
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<?php

$action=$_POST["action"];
if($action=="edit"){
	$sql="select * from hy_member where user_id='".$_SESSION["user_id"]."' and user_pws='$oldpwd'";
	$objDb->query($sql);
	$row=$objDb->get_data();
	if(!$row){
		echo "<script>alert('旧密码错误，请重新输入!');history.go(-1);</script>";
		exit;
	}
	$sql="update hy_member set `user_pws`='$user_pws' where user_id='$user_id'";
	$result=$objDb->query($sql);
	if($result){
		echo "<script>alert('修改成功!');history.go(-1);</script>";
		exit;
	}
	else{
		echo "<script>alert('修改失败，请重试!');history.go(-1);</script>";
		exit;
	}
}

$sql="select * from hy_member where user_id='".$_SESSION["user_id"]."'";
$objDb->query($sql);
$row=$objDb->get_data();
if($row){
	$struserid=$row[0]["user_id"];
	$struserpws=$row[0]["user_pws"];
}
?>
<?php include_once('header.php');?>
<div class="main mid">
   <?php include_once('member_left.php');?>
   <div class="main_right2">
      <div class="main_nav2"><a href="index.php">首页</a> > <a href="account.php">会员中心</a> > 转积分</div>
      <div class="main_bt2">赠送积分</div>
         <div class="main_txt2">
		 
		  <form action="" method="post" id="form1" onsubmit="return checkFrm(this)">
		          <input name="action" type="hidden" value="zjf" />
		           <input name="name" type="hidden" value="<?php echo $_SESSION['user_name'];?>" />
               <input name="uid" type="hidden" value="<?=$struserid?>" />
        <table width="100%" border="0" cellpadding="10" cellspacing="0" class="pro_info" >
          <tr class="order_table_2">
            <td align="right">卡号：</td>
            <td align="left"><input name="kahao" type="input" id="kahao" /></td>
          </tr>
            <tr class="order_table_2">
            <td align="right">积分：</td>
            <td align="left"><input name="zhifen" type="input" id="zhifen" /></td>
          </tr>
          <tr class="order_table_2">
            <td width="20%" align="right" valign="top">密码：</td>
            <td width="760" align="left"><input name="password" type="password" id="password" />
              *</td>
          </tr>
       
          <tr>
            <td align="right" valign="top">&nbsp;</td>
            <td valign="top"><span style="padding-top:20px; padding-bottom:20px;">
              <input type="submit" class="btn" value="提交"  name="Submit" border="0" />
            </span></td>
          </tr>
        </table>
		</form>
		
         </div>
      <div class="page"></div>
   </div>
</div>
<?php include_once('footer.php');?>
</body>
</html>
